#!/bin/bash 

rm -rf *.out
rm -rf *.err
cd ..
make || exit
cd errtest
for path in *
do
	N=`awk -v fn=$path 'BEGIN {print substr(fn,0,3)}'`
	O=${path/in/out}
	E=${path/in/err}
	if [ $N == "in" ] 
	then
		echo testing $path ...
		../demo $path > $path.out 2> $path.err  && diff -u -w $path.err $E ; diff -u -w $path.out $O

	fi
done
